using System.Collections.Generic;
using Castle.ActiveRecord;

namespace DataBaseGeneration.Domain
{
    [ActiveRecord(Lazy = true)]
    public class Customer
    {
        [Property(ColumnType = "String", Length = 64)]
        public virtual string FirstName { get; set; }

        [Property(ColumnType = "String", Length = 64)]
        public virtual string LastName { get; set; }

        [PrimaryKey(PrimaryKeyType.Native, ColumnType = "Int64")]
        public virtual long Id { get; set; }

        [HasAndBelongsToMany(typeof (Product), ColumnRef = "IdProduct", ColumnKey = "IdCustomer", Inverse = true,
            Lazy = true, Table = "CustomerProduct")]
        public virtual IList<Product> Products { get; set; }
    }
}